FROM mysql:5.7.26
COPY ./init/init.sql /docker-entrypoint-initdb.d/
ADD sql.tar.gz /opt
ENV THIS_IP 192.168.2.208
COPY ./5.7/mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
    chown -R mysql:mysql /docker-entrypoint-initdb.d/ && \
    chown -R mysql:mysql /opt/sql/ && \
    sed -i "s/192.168.8.111/${THIS_IP}/g" "/opt/sql/cc-game-mili.sql" && \
    sed -i "s/192.168.8.111/${THIS_IP}/g" "/opt/sql/gs.sql" && \
    sed -i "s/192.168.8.111/${THIS_IP}/g" "/opt/sql/ocenter.sql"
